load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "indexrec",
    srcs = [
        "candidate.go",
        "hypothetical_index.go",
        "hypothetical_table.go",
        "rec.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/indexrec",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/geo/geoindex",
        "//pkg/geo/geopb",
        "//pkg/roachpb",
        "//pkg/sql/catalog/colinfo",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/opt",
        "//pkg/sql/opt/cat",
        "//pkg/sql/opt/memo",
        "//pkg/sql/sem/tree",
        "//pkg/sql/types",
        "//pkg/util/intsets",
        "@com_github_cockroachdb_errors//:errors",
    ],
)

go_test(
    name = "indexrec_test",
    srcs = [
        "candidate_test.go",
        "hypothetical_table_test.go",
        "indexrec_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":indexrec"],
    deps = [
        "//pkg/sql/opt/cat",
        "//pkg/sql/opt/memo",
        "//pkg/sql/opt/testutils/opttester",
        "//pkg/sql/opt/testutils/testcat",
        "//pkg/sql/types",
        "//pkg/testutils/datapathutils",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "@com_github_cockroachdb_datadriven//:datadriven",
    ],
)
